package com.example.yk_lx.login;

import androidx.lifecycle.MutableLiveData;

import com.example.yk_lx.baseMVVM.BaseRepo;
import com.hyphenate.EMCallBack;

public class LoginRepo extends BaseRepo {
    public void login(String username, String password, MutableLiveData<String> success,MutableLiveData<String> fail){
        client.logout(true);
        client.login(username, password, new EMCallBack() {
            @Override
            public void onSuccess() {
                success.postValue("登录成功");
            }

            @Override
            public void onError(int code, String error) {
                fail.postValue(error);
            }
        });
    }
}
